<template>
  <div>
    <div style="margin: 10px 0 10px 10px;">
      <el-button type="primary">新增</el-button>
      <el-button type="primary">导入</el-button>
      <el-button type="primary">导出</el-button>
    </div>
    <div style="margin: 10px 0 10px 10px; width: 20%; display: flex;">
      <el-input v-model="search" placeholder="请输入关键字"></el-input>
      <el-button type="primary" style="margin-left: 10px;">查询</el-button>
    </div>
    <div style="padding: 10px;">
      <el-table :data="tableData" border stripe style="width: 100%">
        <el-table-column prop="date" label="Date" sortable width="200" />
        <el-table-column prop="name" label="Name" width="200" />
        <el-table-column prop="address" label="Address" />
        <el-table-column fixed="right" label="操作" width="200">
          <template #default>
            <el-button size="small" @click="handleEdit">
              编辑
            </el-button>
            <!-- <el-button link type="text" size="small">删除</el-button> -->
            <el-popconfirm title="确认删除吗">
              <template #reference>
                <el-button type="danger" size="small">删除</el-button>
              </template>
            </el-popconfirm>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div style="margin: 10px 0 10px 10px; display:flex; justify-content:center;">
      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
        :page-sizes="[5, 10, 20]" :page-size="10" layout="total, sizes, prev, pager, next, jumper" :total="total">
      </el-pagination>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HomeView',
  components: {

  },
  data() {
    return {
      search: '',
      currentPage: 1,
      total: 10,
      tableData: [
        {
          date: '2016-05-03',
          name: 'Tom',
          address: 'No. 189, Grove St, Los Angeles',
        },
        {
          date: '2016-05-02',
          name: 'Tom',
          address: 'No. 189, Grove St, Los Angeles',
        },
        {
          date: '2016-05-04',
          name: 'Tom',
          address: 'No. 189, Grove St, Los Angeles',
        },
        {
          date: '2016-05-01',
          name: 'Tom',
          address: 'No. 189, Grove St, Los Angeles',
        },
      ]
    }
  },
  methods: {
    handleEdit() { },
    handleSizeChange() { },
    handleCurrentChange() { }
  }
}
</script>

<style scoped></style>
